import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  // 大屏页面
  {
    path: '/',
    name: 'MapView',
    component: () => import('../views/MapView.vue'),
    meta: {
      title: '加砖信息街道养老数据平台'
    }
  },
  // 后台页面
  {
    path: '/UpdateData',
    name: 'UpdateData',
    component: () => import('../views/UpdateData.vue'),
    meta: {
      title: '加砖信息街道大屏后台管理系统'
    }
  },
]

const router = new VueRouter({
  routes
})

router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})



export default router